//https://leetcode.cn/problems/count-special-quadruplets/description/


func countQuadruplets(nums []int) int {
	ans := 0
	for i := 0; i < len(nums); i++ {
		for j := i + 1; j < len(nums); j++ {
			for k := j + 1; k < len(nums); k++ {
				for o := k + 1; o < len(nums); o++ {
					if nums[i] + nums[j] + nums[k] == nums[o]{
						ans++
					}
				}
			}
		}
	}
	return ans
}